var JSON;
JSON || (JSON = {});
(function () {
    function a(a) {
        return 10 > a ? "0" + a : a
    }

    function b(a) {
        e.lastIndex = 0;
        return e.test(a) ? '"' + a.replace(e, function (a) {
            var b = h[a];
            return"string" === typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
        }) + '"' : '"' + a + '"'
    }

    function c(a, d) {
        var e, h, m, p, s = f, o, j = d[a];
        j && ("object" === typeof j && "function" === typeof j.toJSON) && (j = j.toJSON(a));
        "function" === typeof k && (j = k.call(d, a, j));
        switch (typeof j) {
            case "string":
                return b(j);
            case "number":
                return isFinite(j) ? "" + j : "null";
            case "boolean":
            case "null":
                return"" + j;
            case "object":
                if (!j)return"null";
                f += g;
                o = [];
                if ("[object Array]" === Object.prototype.toString.apply(j)) {
                    p = j.length;
                    for (e = 0; e < p; e += 1)o[e] = c(e, j) || "null";
                    m = 0 === o.length ? "[]" : f ? "[\n" + f + o.join(",\n" + f) + "\n" + s + "]" : "[" + o.join(",") + "]";
                    f = s;
                    return m
                }
                if (k && "object" === typeof k) {
                    p = k.length;
                    for (e = 0; e < p; e += 1)"string" === typeof k[e] && (h = k[e], (m = c(h, j)) && o.push(b(h) + (f ? ": " : ":") + m))
                } else for (h in j)Object.prototype.hasOwnProperty.call(j, h) && (m = c(h, j)) && o.push(b(h) + (f ? ": " : ":") + m);
                m = 0 === o.length ? "{}" : f ? "{\n" + f + o.join(",\n" +
                    f) + "\n" + s + "}" : "{" + o.join(",") + "}";
                f = s;
                return m
        }
    }

    "function" !== typeof Date.prototype.toJSON && (Date.prototype.toJSON = function () {
        return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + a(this.getUTCMonth() + 1) + "-" + a(this.getUTCDate()) + "T" + a(this.getUTCHours()) + ":" + a(this.getUTCMinutes()) + ":" + a(this.getUTCSeconds()) + "Z" : null
    }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () {
        return this.valueOf()
    });
    var d = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        e = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, f, g, h = {"\u0008":"\\b", "\t":"\\t", "\n":"\\n", "\u000c":"\\f", "\r":"\\r", '"':'\\"', "\\":"\\\\"}, k;
    "function" !== typeof JSON.stringify && (JSON.stringify = function (a, b, d) {
        var e;
        g = f = "";
        if (typeof d === "number")for (e = 0; e < d; e = e + 1)g = g + " "; else typeof d === "string" && (g = d);
        if ((k = b) && typeof b !== "function" && (typeof b !== "object" || typeof b.length !== "number"))throw Error("JSON.stringify");
        return c("",
            {"":a})
    });
    "function" !== typeof JSON.parse && (JSON.parse = function (a, b) {
        function c(a, d) {
            var e, f, g = a[d];
            if (g && typeof g === "object")for (e in g)if (Object.prototype.hasOwnProperty.call(g, e)) {
                f = c(g, e);
                f !== void 0 ? g[e] = f : delete g[e]
            }
            return b.call(a, d, g)
        }

        var e, a = "" + a;
        d.lastIndex = 0;
        d.test(a) && (a = a.replace(d, function (a) {
            return"\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
        }));
        if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
            "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
            e = eval("(" + a + ")");
            return typeof b === "function" ? c({"":e}, "") : e
        }
        throw new SyntaxError("JSON.parse");
    })
})();
(function (a) {
    a.guang = a.guang || {version:"v1.0.0"};
    a.extend(a.guang, {util:{getUrlParam:function (a) {
        a = RegExp("(^|&)" + a + "=([^&]*)(&|$)");
        a = window.location.search.substr(1).match(a);
        return null != a ? unescape(a[2]) : null
    }, isIE6:function () {
        return a.browser.msie && "6.0" == a.browser.version ? !0 : !1
    }, isIOS:function () {
        return/\((iPhone|iPad|iPod)/i.test(navigator.userAgent)
    }, trim:function (a) {
        return a.replace(/(^\s*)|(\s*$)/g, "")
    }, lTrim:function (a) {
        return a.replace(/(^\s*)/g, "")
    }, rTrim:function (a) {
        return a.replace(/(\s*$)/g,
            "")
    }, getStrLength:function (b) {
        var b = a.guang.util.trim(b), c = 0, b = b.replace(/[^\x00-\xff]/g, "**").length;
        return c = parseInt(b / 2) == b / 2 ? b / 2 : parseInt(b / 2) + 0.5
    }, substring4ChAndEn:function (b, c) {
        for (var d = b.substring(0, 2 * c); a.guang.util.getStrLength(d) > c;)d = d.substring(0, d.length - 1);
        return d
    }, htmlToTxt:function (a) {
        return a = a.replace(/\<|\>|\"|\'|\&/g, function (a) {
            switch (a) {
                case "<":
                    return"\uff1c";
                case ">":
                    return"\uff1e";
                case '"':
                    return"\uff3c";
                case "'":
                    return"\uff07";
                case "&":
                    return"\uff06"
            }
        })
    }, ellipse:function (b, c) {
        var d = 2 * a.guang.util.getStrLength(b) > c;
        return b && d ? b.replace(RegExp("([\\s\\S]{" + c + "})[\\s\\S]*"), "$1\u2026") : b
    }, isEmpty:function (b) {
        return"" == a.guang.util.trim(b) ? !1 : !0
    }, isEmail:function (a) {
        return/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(a)
    }, isNick:function (a) {
        return/^[a-zA-Z\d\u4e00-\u9fa5_-]*$/.test(a)
    }, nickMin:function (b) {
        return 4 > 2 * a.guang.util.getStrLength(b) ? !1 : !0
    }, nickMax:function (b) {
        return 30 < 2 * a.guang.util.getStrLength(b) ? !1 : !0
    }, tooShort:function (a, c) {
        return a.length <
            c ? !1 : !0
    }, noLink:function (a) {
        return null == a.match(/(http[s]?:\/\/)?[a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+/) ? !0 : !1
    }, getPosition:function (b) {
        var c = b.offset().top, d = b.offset().left, e = c + b.outerHeight(), f = d + b.outerWidth(), g = d + b.outerWidth() / 2, h = c + b.outerHeight() / 2;
        /iPad/i.test(navigator.userAgent) && (c -= a(window).scrollTop(), e -= a(window).scrollTop(), h -= a(window).scrollTop());
        return{leftTop:function () {
            return{x:d, y:c}
        }, leftMid:function () {
            return{x:d, y:h}
        }, leftBottom:function () {
            return{x:d, y:e}
        }, topMid:function () {
            return{x:g,
                y:c}
        }, rightTop:function () {
            return{x:f, y:c}
        }, rightMid:function () {
            return{x:f, y:h}
        }, rightBottom:function () {
            return{x:f, y:e}
        }, MidBottom:function () {
            return{x:g, y:e}
        }, middle:function () {
            return{x:g, y:h}
        }}
    }, getDomain:function (a) {
        var c = "null", a = /[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/.exec(a);
        "undefined" != typeof a && null != a && (c = a[0]);
        return c
    }, validSite:function (b) {
        var c = a.guang.util.getDomain(b);
        if (-1 != b.indexOf("guang.com"))return"guang.com" == c && -1 != b.indexOf("baobei/") ? "guang" : !1;
        if (-1 != b.indexOf("tmall.com")) {
            var d = !0, e;
            e = ("detail.tmall.com" == c || "item.tmall.com" == c) && -1 != b.indexOf("item.htm?");
            bool4 = ("detail.tmall.com" == c || "item.tmall.com" == c) && -1 != b.indexOf("spu_detail.htm?");
            switch (d) {
                case e:
                    return"tmall3";
                case bool4:
                    return"tmall4";
                default:
                    return!1
            }
        } else if (-1 != b.indexOf("taobao.com"))switch (d = !0, b = ("item.taobao.com" == c || "item.beta.taobao.com" == c || "item.lp.taobao.com" == c) && -1 != b.indexOf("item.htm?"), d) {
            case b:
                return"taobao";
            default:
                return!1
        } else {
            if (-1 != b.indexOf("item.buy.qq.com"))return"item.buy.qq.com" ==
                c ? "qqbuy" : !1;
            if (-1 != b.indexOf("vancl.com"))switch (b = "item.vancl.com" == c && -1 == b.indexOf("ch_vt"), c = "item.vt.vancl.com" == c, !0) {
                case b:
                    return"vancl";
                case c:
                    return"vancl";
                default:
                    return!1
            } else return-1 != b.indexOf("item.mbaobao.com") ? "item.mbaobao.com" == c ? "mbaobao" : !1 : !1
        }
    }, openWin:function (a) {
        var c = a.substr(a.lastIndexOf("snsType=") + 8, 1);
        4 == c || 5 == c ? (c = 820 < document.body.clientWidth ? (document.body.clientWidth - 820) / 2 : 0, window.open(a, "connect_window", "height=700, width=820, toolbar=no, menubar=no, scrollbars=yes, resizable=no,top=190,left=" +
            c + ", location=no, status=no")) : 8 == c ? (c = (document.body.clientWidth - 580) / 2, window.open(a, "connect_window", "height=620, width=580, toolbar=no, menubar=no, scrollbars=yes, resizable=no,top=190,left=" + c + ", location=no, status=no")) : 9 == c ? (c = 900 < document.body.clientWidth ? (document.body.clientWidth - 900) / 2 : 0, window.open(a, "connect_window", "height=550, width=900, toolbar=no, menubar=no, scrollbars=yes, resizable=no,top=190,left=" + c + ", location=no, status=no")) : (c = (document.body.clientWidth - 580) / 2, window.open(a,
            "connect_window", "height=420, width=580, toolbar=no, menubar=no, scrollbars=yes, resizable=no,top=190,left=" + c + ", location=no, status=no"))
    }, moveEnd:function (a) {
        a.focus();
        var c = a.value.length;
        document.selection ? (a = a.createTextRange(), a.moveStart("character", c), a.collapse(), a.select()) : "number" == typeof a.selectionStart && "number" == typeof a.selectionEnd && (a.selectionStart = a.selectionEnd = c)
    }, submitByEnter:function (a, c) {
        a = a || window.event;
        13 == (a ? a.charCode || a.keyCode : 0) && c()
    }}});
    a.fn.extend({returntop:function () {
        if (this[0]) {
            var b =
                this.click(function () {
                    a("html, body").animate({scrollTop:0}, 120)
                }), c = null;
            a(window).bind("scroll", function () {
                var d = a(document).scrollTop(), e = a(window).height();
                0 < d ? b.css("bottom", "200px") : b.css("bottom", "-200px");
                a.guang.util.isIE6() && (b.hide(), clearTimeout(c), c = setTimeout(function () {
                    b.show();
                    clearTimeout(c)
                }, 1E3), b.css("top", d + e - 125))
            })
        }
    }, resizeImage:function (b, c) {
        this.each(function () {
            var d = a(this)[0], e = d.width, f = d.height;
            e <= b && f <= c || (e <= b && f > c ? (d.width = e * c / f, d.height = c) : e > b && f <= c ? (d.width = b, d.height =
                f * b / e) : (d.width = b, d.height = f * b / e, f * b / e > c && (d.width = e * c / f, d.height = c)))
        })
    }, textareaAutoHeight:function () {
        var b = this, c = b.outerHeight();
        b.bind("keyup input propertychange focus", function () {
            0 > c && (c = b.outerHeight());
            (a.browser.mozilla || a.browser.safari) && b.height(c);
            var d = b[0].scrollHeight, e = d < c ? c : d, e = e < 1.5 * c ? c : d;
            b.height(e)
        })
    }, disableBtn:function (a) {
        this[0].disabled = "disabled";
        this.removeClass(a).addClass("disabled")
    }, enableBtn:function (a) {
        this[0].disabled = "";
        this.removeClass("disabled").addClass(a)
    },
        dropDown:function (b) {
            var c = {event:"mouseover", classNm:".dropdown", timer:null, fadeSpeed:100, duration:500, offsetX:82, offsetY:8, isLocation:!1};
            b && a.extend(c, b);
            var d = a(c.classNm);
            this.each(function () {
                $this = a(this);
                $this.hover(function () {
                    clearTimeout(c.timer);
                    a(".dropdown:not(" + c.classNm + ")").hide();
                    if (c.isLocation) {
                        var b = a.guang.util.getPosition(a(this)).rightBottom();
                        d.css({left:b.x - c.offsetX + "px", top:b.y + c.offsetY + "px"})
                    }
                    d.fadeIn(c.fadeSpeed)
                }, function () {
                    c.timer = setTimeout(function () {
                            d.fadeOut(c.fadeSpeed)
                        },
                        c.duration)
                });
                d.hover(function () {
                    clearTimeout(c.timer);
                    d.show()
                }, function () {
                    c.timer = setTimeout(function () {
                        d.fadeOut(c.fadeSpeed)
                    }, c.duration)
                })
            })
        }})
})(jQuery);
(function (a) {
    a("a[rel=loginD]")[0] && a("a[rel=loginD]").click(function (b) {
        b.preventDefault();
        a.guang.dialog.login()
    });
    a.guang.dialog = {isLogin:function () {
        return"" == GUANGER.userId ? (a.guang.dialog.login(), !1) : !0
    }, login:function () {
        if (a("#loginDialog")[0])a("#loginDialog").data("overlay").load(); else {
            var b;
            b = '<div id="loginDialog" class="g-dialog"><div class="dialog-content"><div class="hd"><h3>\u767b\u5f55</h3></div><div class="bd clearfix"><div class="bd-l">' + ('<form id="J_LoginDForm" action="' + GUANGER.path +
                '/emailLogin" method="POST">');
            b = b + '<div class="error-row"><p class="error"></p></div><div class="form-row"><label>Email\uff1a</label><input type="text" class="base-input" name="email" id="email" value="" placeholder="" /></div><div class="form-row"><label>\u5bc6\u7801\uff1a</label><input type="password" class="base-input" name="password" id="password" value="" /></div><div class="form-row"><label>&nbsp;</label><input type="checkbox" class="check" name="remember" value="1" checked="checked" /><span>\u4e24\u5468\u5185\u81ea\u52a8\u767b\u5f55</span></div><div class="form-row act-row clearfix"><label>&nbsp;</label><input type="submit" class="bbl-btn login-submit" value="\u767b\u5f55" />' +
                ('<a class="ml10 l30" href="' + GUANGER.path + '/resetpwd">\u5fd8\u8bb0\u5bc6\u7801\uff1f</a></div>');
            b = b + '</form></div><div class="bd-r"><p>\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u5e10\u53f7\u767b\u5f55</p><div class="snslogin mt15 clearfix"><ul class="fl mr20 outlogin-b">' + ('<li><a class="l-qq" href="' + GUANGER.path + '/snsLogin?snsType=4&backType=1">QQ\u5e10\u53f7\u767b\u5f55</a></li>');
            b += '<li><a class="l-sina" href="' + GUANGER.path + '/snsLogin?snsType=3&backType=1">\u65b0\u6d6a\u5fae\u535a\u767b\u5f55</a></li>';
            b += '<li><a class="l-tao" href="' + GUANGER.path + '/snsLogin?snsType=8&backType=1">\u6dd8\u5b9d\u5e10\u53f7\u767b\u5f55</a></li>';
            b = b + '</ul><ul class="fl outlogin-s share-link">' + ('<li><a class="s-alipay" href="' + GUANGER.path + '/snsLogin?snsType=9&backType=1">\u652f\u4ed8\u5b9d</a></li>');
            b += '<li><a class="s-tencent" href="' + GUANGER.path + '/snsLogin?snsType=5&backType=1">\u817e\u8baf\u5fae\u535a</a></li>';
            b += '<li><a class="s-douban" href="' + GUANGER.path + '/snsLogin?snsType=6&backType=1">\u8c46\u74e3</a></li>';
            b += '<li><a class="s-renren" href="' + GUANGER.path + '/snsLogin?snsType=7&backType=1">\u4eba\u4eba\u7f51</a></li>';
            a("body").append(b + '</ul></div></div></div><a class="close" href="javascript:;"></a></div></div>');
            a("#loginDialog").overlay({top:"center", mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!1, load:!0});
            a("#J_LoginDForm").submit(function () {
                $this = a(this);
                a.post($this.attr("action"), $this.serializeArray(), function (b) {
                    100 == b.code ? (a("#loginDialog").overlay().close(), window.location.reload()) :
                        101 == b.code && (a("#loginDialog").find(".error-row").fadeIn(), a("#loginDialog").find(".error").html(b.message), a("#loginDialog input[name=password]").val(""))
                });
                return!1
            });
            a(".snslogin a").unbind("click").click(function () {
                var b = a(this).attr("href");
                a.guang.util.openWin(b);
                return!1
            });
            a("#loginDialog").overlay().getClosers().bind("click", function () {
                a("#J_LoginDForm")[0].reset();
                a("#loginDialog").find(".error-row").hide()
            })
        }
    }}
})(jQuery);
(function (a) {
    a.guang.goods = {conf:{distance:400, page:1, container:".goods-block", colArray:[], containerW:960, columns:4, columnWidthInner:210, columnMargin:13, columnPadding:20, columnWidthOuter:243, ajaxUrl:GUANGER.path + "/xihuan/book", loadFlag:!1, ajaxData:{spage:null, bpage:null, cateId:null, tagId:null, userId:null, pubTime:null, sort:null}, justFlow:!1, isGrid:!1, isAjaxLoad:"true"}, init:function () {
        var b = a.guang.goods, c = a.guang.goods.conf;
        c.columnWidthOuter = c.columnWidthInner + c.columnMargin + c.columnPadding;
        if (0 ==
            c.colArray.length)for (var d = 0; d < c.columns; d++)c.colArray[d] = 0;
        d = a(".goods-wall").find(".goods");
        c.justFlow ? (b.flowGoods(d), b.fill()) : (c.isGrid ? (d = a(".goods-wall-news").find(".goods-news"), a(".goods-wall-news").each(function () {
            var b = a(this);
            b.find(".goods-news").css("height", b.outerHeight() - 20)
        }), a(".page-box").show()) : 0 < d.length && "true" == c.isAjaxLoad ? b.flowGoods(d) : b.ajaxLoad(), a(window).bind("scroll", b.lazyLoad));
        d.live("mouseover mouseout", function (b) {
            var c = a(this);
            if (b.type == "mouseover") {
                c.css({color:"#666",
                    "box-shadow":"0 1px 2px rgba(35,25,25,0.5)", "-moz-box-shadow":"0 1px 2px rgba(35,25,25,0.5)", "-webkit-box-shadow":"0 1px 2px rgba(35,25,25,0.5)"});
                c.find(".ilike-m")[0] && c.find(".ilike-m").show();
                c.find(".ilike-del")[0] && c.find(".ilike-del").show();
                c.find(".ilike-topic")[0] && c.find(".ilike-topic").show()
            } else {
                c.css({color:"#999", "box-shadow":"0 1px 2px rgba(34,25,25,0.2)", "-moz-box-shadow":"0 1px 2px rgba(34,25,25,0.2)", "-webkit-box-shadow":"0 1px 2px rgba(34,25,25,0.2)"});
                c.find(".ilike-m")[0] &&
                c.find(".ilike-m").hide();
                c.find(".ilike-del")[0] && c.find(".ilike-del").hide();
                c.find(".ilike-topic")[0] && c.find(".ilike-topic").hide()
            }
        })
    }, isLoading:!1, lazyLoad:function () {
        var b = a.guang.goods, c = a.guang.goods.conf, d = a(document).height() - a(window).scrollTop() - a(window).height();
        !b.isLoading && d < c.distance && (b.isLoading = !0, b.ajaxLoad())
    }, ajaxLoad:function () {
        var b = a.guang.goods, c = a.guang.goods.conf;
        a.guang.goods.conf.ajaxData.spage = c.page;
        a(".goods-loading").show();
        if ("false" == c.isAjaxLoad) {
            var d = a("#J_GoodsShow"),
                e, f = 20 * (c.page - 1), g = 20 * c.page, f = d.find(".goods").slice(f, g);
            d.find(".goods").slice(g, goodsPage.sumGoodsNum).each(function () {
                a(this)[0].style.display = "none"
            });
            f.each(function () {
                var b = a(this)[0], d = jQuery.inArray(Math.min.apply(Math, c.colArray), c.colArray), f = c.colArray[d];
                b.style.top = f + "px";
                b.style.left = d * c.columnWidthOuter + "px";
                b.style.display = "block";
                1 < c.page && (e = a(this).find("img:first"), e.attr("src", e.attr("data-src")));
                c.colArray[d] = f + b.offsetHeight + c.columnMargin
            }).animate({opacity:"1"}, 500);
            a(".goods-wall")[0] &&
            (a(".goods-wall")[0].style.height = Math.max.apply(Math, c.colArray) + "px");
            c.page += 1;
            b.isLoading = !1;
            if (6 == c.page || 20 > f.length || 20 >= d.find(".goods").length)b.fill(), a(".goods-loading").remove(), a(".page-box").show(), a(window).unbind("scroll", b.lazyLoad), (c.loadFlag = !0) && jQuery.guang.fallGoods.init()
        } else a.post(c.ajaxUrl, c.ajaxData, function (d) {
            var e = a("<div>" + d + "</div>").find(".goods"), f = a("<div>" + d + "</div>").find(".J_HiddenSpage:last").val(), g = a("<div>" + d + "</div>").find(".J_HiddenIsEnd:last").val(),
                d = a("<div>" + d + "</div>").find(".J_HiddenLastPubTime:last").val();
            a.guang.goods.conf.ajaxData.pubTime = d;
            b.flowGoods(e);
            c.page += 1;
            b.isLoading = !1;
            if (6 == c.page || "true" == g || "5" == f)b.fill(), a(".goods-loading").remove(), a(".page-box").show(), a(window).unbind("scroll", b.lazyLoad)
        })
    }, flowGoods:function (b) {
        var c = a.guang.goods, d = a.guang.goods.conf;
        a(".goods-block")[0] || a(".goods-wall").append('<div class="goods-block"></div>');
        b.each(function () {
            var b = a(this)[0], c = jQuery.inArray(Math.min.apply(Math, d.colArray),
                d.colArray), g = d.colArray[c];
            b.style.top = g + "px";
            b.style.left = c * d.columnWidthOuter + "px";
            a(d.container + ":last").append(b);
            d.colArray[c] = g + b.offsetHeight + d.columnMargin
        });
        a(".goods-wall")[0] && (a(".goods-wall")[0].style.height = Math.max.apply(Math, d.colArray) + "px");
        c.showGoods()
    }, showGoods:function () {
        var b = a.guang.goods.conf;
        2 < b.page ? a(b.container + ":last").animate({opacity:"1"}, 100) : a(b.container + ":last").css("opacity", "1")
    }, fill:function () {
        for (var b = a.guang.goods.conf, c = Math.max.apply(Math, b.colArray),
                 d = jQuery.inArray(c, b.colArray), e = 0; e < b.columns; e++)e != d && a(b.container + ":last").append('<div class="goods-fill" style="top:' + b.colArray[e] + "px;left:" + e * b.columnWidthOuter + "px;height:" + (c - b.colArray[e] - b.columnMargin) + 'px"></div>')
    }}
})(jQuery);
(function (a) {
    a.guang.fallGoods = {conf:{distance:400, page:1, limitNum:100, container:".goods-new-block", colArray:[], containerW:960, columns:4, columnWidthInner:210, columnMargin:13, columnPadding:20, columnWidthOuter:243}, init:function () {
        var b = a.guang.fallGoods, c = b.conf;
        c.columnWidthOuter = c.columnWidthInner + c.columnMargin + c.columnPadding;
        if (0 == c.colArray.length)for (var d = 0; d < c.columns; d++)c.colArray[d] = 0;
        a(c.container).find(".goods").live("mouseover mouseout", function (b) {
            var c = a(this);
            "mouseover" == b.type ?
                (c.css({color:"#666", "box-shadow":"0 1px 2px rgba(35,25,25,0.5)", "-moz-box-shadow":"0 1px 2px rgba(35,25,25,0.5)", "-webkit-box-shadow":"0 1px 2px rgba(35,25,25,0.5)"}), c.find(".ilike-m")[0] && c.find(".ilike-m").show(), c.find(".ilike-del")[0] && c.find(".ilike-del").show(), c.find(".ilike-topic")[0] && c.find(".ilike-topic").show()) : (c.css({color:"#999", "box-shadow":"0 1px 2px rgba(34,25,25,0.2)", "-moz-box-shadow":"0 1px 2px rgba(34,25,25,0.2)", "-webkit-box-shadow":"0 1px 2px rgba(34,25,25,0.2)"}), c.find(".ilike-m")[0] &&
                c.find(".ilike-m").hide(), c.find(".ilike-del")[0] && c.find(".ilike-del").hide(), c.find(".ilike-topic")[0] && c.find(".ilike-topic").hide())
        });
        b.load();
        a(window).bind("scroll", b.lazyLoad)
    }, load:function () {
        var b = a.guang.fallGoods, c = b.conf, d = a(c.container), e, f = 20 * (c.page - 1), g = 20 * c.page, f = d.find(".goods").slice(f, g);
        d.find(".goods").slice(g, c.limitNum).each(function () {
            a(this)[0].style.display = "none"
        });
        f.each(function () {
            var b = a(this)[0], d = jQuery.inArray(Math.min.apply(Math, c.colArray), c.colArray), f = c.colArray[d];
            b.style.top = f + "px";
            b.style.left = d * c.columnWidthOuter + "px";
            b.style.display = "block";
            1 < c.page && (e = a(this).find("img:first"), e.attr("src", e.attr("data-src")));
            c.colArray[d] = f + b.offsetHeight + c.columnMargin
        }).animate({opacity:"1"}, 100);
        d.height(Math.max.apply(Math, c.colArray));
        c.page += 1;
        if (6 == c.page || 20 > f.length || 20 >= d.find(".goods").length)b.fill(), a(window).unbind("scroll", b.lazyLoad)
    }, fill:function () {
        for (var b = a.guang.fallGoods.conf, c = Math.max.apply(Math, b.colArray), d = jQuery.inArray(c, b.colArray), e =
            0; e < b.columns; e++)e != d && a(b.container).append('<div class="goods-fill" style="top:' + b.colArray[e] + "px;left:" + e * b.columnWidthOuter + "px;height:" + (c - b.colArray[e] - b.columnMargin) + 'px"></div>')
    }, lazyLoad:function () {
        var b = a.guang.fallGoods, c = b.conf, d = a(document).height() - a(window).scrollTop() - a(window).height();
        !b.isLoading && d < c.distance && b.load()
    }}
})(jQuery);
(function (a) {
    a.guang.gridGoods = {conf:{container:a(".goods-grid-wall"), uinitContainer:a(".goods-wall-news1"), goods:a(".goods-grid-wall").find(".goods-news"), goodsName:"goods-news", distance:400, page:1, pageLimit:6, loadUnit:3, loadMaxUint:16}, init:function () {
        var b = a.guang.gridGoods, c = b.conf;
        c.goods.live("mouseover mouseout", function (b) {
            var c = a(this);
            "mouseover" == b.type ? (c.css({color:"#666", "box-shadow":"0 1px 2px rgba(35,25,25,0.5)", "-moz-box-shadow":"0 1px 2px rgba(35,25,25,0.5)", "-webkit-box-shadow":"0 1px 2px rgba(35,25,25,0.5)"}),
                c.find(".ilike-m")[0] && c.find(".ilike-m").show(), c.find(".ilike-del")[0] && c.find(".ilike-del").show(), c.find(".ilike-topic")[0] && c.find(".ilike-topic").show()) : (c.css({color:"#999", "box-shadow":"0 1px 2px rgba(34,25,25,0.2)", "-moz-box-shadow":"0 1px 2px rgba(34,25,25,0.2)", "-webkit-box-shadow":"0 1px 2px rgba(34,25,25,0.2)"}), c.find(".ilike-m")[0] && c.find(".ilike-m").hide(), c.find(".ilike-del")[0] && c.find(".ilike-del").hide(), c.find(".ilike-topic")[0] && c.find(".ilike-topic").hide())
        });
        c.uinitContainer.each(function () {
            var b =
                a(this);
            b.find("." + c.goodsName).css("height", b.outerHeight() - 20)
        });
        b.load();
        a(window).bind("scroll", b.lazyLoad)
    }, load:function () {
        var b = a.guang.gridGoods, c = b.conf, d = c.page * c.loadUnit, e = c.uinitContainer.slice((c.page - 1) * c.loadUnit, d), d = c.uinitContainer.slice(d, c.loadMaxUint);
        e.each(function () {
            var b = a(this);
            b[0].style.display = "block";
            1 < c.page && b.find("img").each(function () {
                var b = a(this), c = b.attr("data-src");
                b.attr("src", c)
            })
        });
        d.each(function () {
            a(this)[0].style.display = "none"
        });
        c.page += 1;
        (c.page == c.pageLimit ||
            e.length < c.loadUnit || c.uinitContainer.length <= c.loadUnit) && a(window).unbind("scroll", b.lazyLoad)
    }, lazyLoad:function () {
        var b = a.guang.gridGoods, c = b.conf;
        a(document).height() - a(window).scrollTop() - a(window).height() < c.distance && b.load()
    }}
})(jQuery);
(function (a) {
    a.guang.wordCount = {conf:{okClk:function () {
    }, errorClk:function () {
    }}, init:function (b, c, d, e) {
        function f() {
            c.text(g - parseInt(l()))
        }

        var g = d, h = e || 15, k = -1 != e, n = b[0], l = function () {
            var c = a.trim(b.val());
            return a.guang.util.getStrLength(c)
        };
        f();
        b.bind("keypress", function (a) {
            l() >= g && "0" != a.charCode && a.preventDefault()
        });
        b.bind("keyup",function () {
            f();
            if (l() >= g)if (k) {
                n.value = n.value.substr(0, 2 * g + 100);
                var c = setInterval(function () {
                    l() <= g ? (c = clearInterval(c), f()) : (n.value = n.value.substring(0, n.value.length -
                        1), a.guang.wordCount.conf.errorClk(n.value.length))
                }, h)
            } else b[0].value = n.value.substr(0, g)
        }).focus(function () {
                f()
            })
    }};
    a.guang.tipForOper = {conf:{html:""}, init:function () {
        a("#J_TipForOper")[0] ? a("#J_TipForOper").data("overlay").load() : (a("body").append('<div id="J_TipForOper" class="g-dialog tip-for-oper"><div class="dialog-content"><div class="bd clearfix"></div></div></div>'), a("#J_TipForOper").overlay({top:"center", mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!1, load:!0}));
        a("#J_TipForOper").find(".bd").html(a.guang.tipForOper.conf.html);
        a("#J_TipForOper .closeD").click(function () {
            a("#J_TipForOper").overlay().close()
        })
    }};
    a.guang.bindSnsShare = {init:function (b) {
        var c = {type_3:'<li class="share-switch ss-sina-btnclick-on btnclick" data-status="on" data-snsid="3" data-webname="ss-sina"></li>', type_5:'<li class="share-switch ss-tencent-btnclick-on btnclick" data-status="on" data-snsid="5" data-webname="ss-tencent"></li>'};
        a.ajax({url:GUANGER.path + "/account/getUserSns.html", type:"post", dataType:"json", success:function (d) {
            if (100 == d.code) {
                for (var e =
                    "", d = d.userSns, f = 0; f < d.length; f++)c["type_" + d[f]] && (e += c["type_" + d[f]]);
                b.html(e);
                a(".btnclick").bind("click", function () {
                    var b = a(this), c = b.attr("data-webname") + "-btnclick-on", d = b.attr("data-webname") + "-btnclick-off";
                    "on" == b.data("status") ? b.removeClass(c).addClass(d).data("status", "off") : b.removeClass(d).addClass(c).data("status", "on")
                })
            }
        }})
    }}
})(jQuery);
(function (a) {
    a.fn.textSlider = function (b) {
        b = a.extend({speed:"normal", step:1, timer:1E3}, b || {});
        return this.each(function () {
            a.fn.textSlider.scllor(a(this), b)
        })
    };
    a.fn.textSlider.scllor = function (b, c) {
        var d = b.find("ul:eq(0)"), e, f = d.children(), g = a(f[0]).outerHeight(), h = 0 - c.step * g, k = function () {
            d.animate({marginTop:h}, c.speed, function () {
                for (i = 0; i < c.step; i++)d.find("li:first").removeClass("fade"), d.find("li:first").appendTo(d);
                d.css({marginTop:0});
                d.find("li:first").addClass("fade")
            })
        }, g = function () {
            e = window.setInterval(k,
                c.timer)
        };
        5 < f.length && g();
        d.hover(function () {
            window.clearInterval(e)
        }, g)
    }
})(jQuery);
(function (a) {
    a.guang.tip = {conf:{timer:null, timerLength:3E3, tipClass:""}, show:function (b, c) {
        clearTimeout(a.guang.tip.conf.timer);
        var d = a.guang.util.getPosition(b).topMid();
        a(".tipbox")[0] || a("body").append('<div class="tipbox"></div>');
        a(".tipbox").attr("class", "tipbox " + a.guang.tip.conf.tipClass);
        a(".tipbox").html(c);
        var e = a(".tipbox").outerWidth(), f = a(".tipbox").outerHeight();
        a(".tipbox").css({left:d.x - e / 2 + "px", top:d.y - f - 10 + "px"}).fadeIn();
        a.guang.tip.conf.timer = setTimeout(function () {
                a(".tipbox").fadeOut()
            },
            a.guang.tip.conf.timerLength)
    }}
})(jQuery);
(function (a) {
    a.cookie = function (a, c, d) {
        if ("undefined" != typeof c) {
            d = d || {};
            null === c && (c = "", d.expires = -1);
            var e = "";
            if (d.expires && ("number" == typeof d.expires || d.expires.toUTCString))"number" == typeof d.expires ? (e = new Date, e.setTime(e.getTime() + 864E5 * d.expires)) : e = d.expires, e = "; expires=" + e.toUTCString();
            var f = d.path ? "; path=" + d.path : "", g = d.domain ? "; domain=" + d.domain : "", d = d.secure ? "; secure" : "";
            document.cookie = [a, "=", encodeURIComponent(c), e, f, g, d].join("")
        } else {
            c = null;
            if (document.cookie && "" != document.cookie) {
                d =
                    document.cookie.split(";");
                for (e = 0; e < d.length; e++)if (f = jQuery.trim(d[e]), f.substring(0, a.length + 1) == a + "=") {
                    c = decodeURIComponent(f.substring(a.length + 1));
                    break
                }
            }
            return c
        }
    }
})(jQuery);
(function (a) {
    function b(b, d) {
        var e = b.find("ul:eq(0)"), f = e.children(), g = a(f[0]).outerWidth(), h = d.step * g, k = function () {
            e.animate({opacity:1}, d.timer, function () {
                e.find("li").eq(d.limit).css("opacity", 0.5);
                e.animate({marginLeft:-1 * h}, d.speed, function () {
                    e.find("li").eq(d.limit).css("opacity", 1);
                    e.find("li:first").appendTo(e);
                    e.css({marginLeft:0})
                });
                l()
            })
        }, n = function () {
            e.animate({opacity:1}, d.timer, function () {
                e.animate({marginLeft:h}, d.speed, function () {
                    e.find("li:last").hide().prependTo(e).fadeIn();
                    e.css({marginLeft:0})
                });
                l()
            })
        }, l = function () {
            "left" == d.direction ? k() : n()
        };
        f.length > d.length && l();
        e.hover(function () {
            e.stop()
        }, l)
    }

    a.fn.feedSlider = function (c) {
        c = a.extend({speed:"normal", step:1, length:7, timer:3E3, direction:"left", limit:6}, c || {});
        return this.each(function () {
            new b(a(this), c)
        })
    }
})(jQuery);
(function (a) {
    function b(b, d) {
        var e = b.find(".items:eq(0)"), f = e.find(".item").length, g = 0, h = null, k = a(d.navis), n = function (a) {
            e.stop();
            var b = g + 1 == f ? 0 : g + 1;
            a + 1 && (g = a);
            e.animate({left:a + 1 ? -(d.width * a) : -(d.width * b)}, d.speed, function () {
                -1 == a && (g = b, m(g))
            })
        }, l = function (a) {
            "left" == d.direction && n(a)
        }, q = function () {
            r();
            h = setTimeout(function () {
                l(-1);
                q()
            }, d.timer)
        }, r = function () {
            null != h && clearTimeout(h)
        }, m = function (b) {
            a("." + d.naviClass).removeClass(d.naviClass);
            k.eq(b).addClass(d.naviClass)
        };
        k.each(function (b) {
            a(this).hover(function () {
                m(b);
                r();
                l(b)
            }, q)
        });
        b.hover(r, q);
        var p = {playlol:l, autoPlay:q, stopAuto:r, changeClass:m};
        null != d.startHandle ? d.startHandle(p) : q()
    }

    a.fn.scrollImg = function (c) {
        c = a.extend({speed:500, timer:3E3, direction:"left", navis:".navi li", naviClass:"active", eventName:"hover", width:this.width(), startHandle:null}, c || {});
        return this.each(function () {
            new b(a(this), c)
        })
    }
})(jQuery);
(function (a) {
    a.fn.addPic = function (b) {
        b = a.extend({handler:function () {
        }}, b || {});
        a("#J_AddPicD")[0] ? (a(".ap-input").val(""), a(".text-tip").html("")) : (a("body").append('<div id="J_AddPicD" class="g-dialog ap-dialog"><div class="content"><p class="pb5">\u5c06\u56fe\u7247\u7f51\u5740\u7c98\u8d34\u5230\u4e0b\u9762\u7684\u6846\u4e2d\uff1a</p><form class="ap-form" name="addPic" action=""><div class="clearfix"><input class="base-input ap-input" name="photos" value="" placeholder="http://" /><input type="submit" class="sbl-btn src-sub" value="\u6dfb\u52a0" /></div><div class="text-tip"></div></form><a class="close" href="javascript:;"></a></div></div>'),
            a(".ap-dialog .close").click(function () {
                a("#J_AddPicD").fadeOut("fast")
            }), a("#J_AddPicD .ap-form").submit(function () {
            a(this);
            "" == a.guang.util.trim(a("#J_AddPicD .ap-input").val()) ? a(".text-tip").html('<span class="errc">\u56fe\u7247\u7f51\u5740\u4e0d\u80fd\u4e3a\u7a7a~</span>').show() : (b.handler(), a("#J_AddPicD").fadeOut("fast"));
            return!1
        }));
        var c = a.guang.util.getPosition(this).topMid(), d = a("#J_AddPicD").outerWidth(), e = a("#J_AddPicD").outerHeight();
        a("#J_AddPicD").css({left:c.x - d / 2 + "px", top:c.y - e -
            10 + "px"}).fadeIn("fast")
    };
    a.fn.addLocalPic = function () {
        var b = !0;
        if (!a("#J_AddPicD")[0]) {
            var c;
            c = '<div id="J_AddPicD" class="g-dialog ap-dialog"><div class="dialog-content"><div class="up-pic J_UpPic" style="position:absolute;top:34px;left:50px;">' + ('<form  id="J_PicUploadForm" target="picUploadTarget" action="' + GUANGER.path + '/ugc/api/uploadPic.html" method="post" enctype="multipart/form-data">');
            a("body").append(c + '<div class="photo-file-row clearfix"><button  id="J_BtnPic" class="bbl-btn upload-cover">\u4ece\u7535\u8111\u9009\u62e9\u56fe\u7247</button><input type="file" name="filedata" class="upload-btn" id="J_FileInput" onChange="window.submitPic(this)" size="1" hideFocus="true"/></div><div style="margin-top:5px;color:#666;"><span>\u4ec5\u652f\u6301JPG/JPEG/PNG/BMP\u56fe\u7247\u6587\u4ef6,\u6587\u4ef6\u5c0f\u4e8e2M,<br/>\u56fe\u7247\u5c3a\u5bf8\u5927\u5c0f250*250\uff5e1200*1800.</span></div><div class="text-tip"></div></form></div><div class="loadding J_PicLoadding" style="visibility:hidden;position: absolute;bottom: 0px;left:50px;"></div><iframe name="picUploadTarget" id="picUploadTarget" width="0" height="0" style="display:none" frameborder="0" allowtransparent="yes" scrolling="no"></iframe><a class="close" href="javascript:;"></a></div></div>');
            a(".ap-dialog .close").click(function () {
                a("#J_AddPicD").fadeOut("fast")
            })
        }
        a(".text-tip").html("").hide();
        a(".J_PicLoadding:first").css("visibility", "hidden");
        c = a.guang.util.getPosition(this).topMid();
        var d = a("#J_AddPicD").outerWidth(), e = a("#J_AddPicD").outerHeight();
        a("#J_AddPicD").css({left:c.x - d / 2 + "px", top:c.y - e - 10 + "px"}).fadeIn("fast");
        window.submitPic = function (c) {
            a(".text-tip").html("").hide();
            a(".J_PicLoadding:first").css("visibility", "hidden");
            if (!b)return!1;
            var d = a(".J_PicLoadding:first"),
                e;
            e = /\.(jpg|jpeg|png|bmp)$/i.test(a(c).val()) ? !0 : !1;
            e ? (a(c).closest("form").submit(), b = !1, d.html('<img src="images/admin/loading.gif"/><br/>').css("visibility", "visible")) : (a(".text-tip").html('<span class="errc">\u4eb2,\u56fe\u7247\u683c\u5f0f\u4e0d\u5bf9.</span>').show(), b = !0)
        };
        window.publishPicSuccess = function (c, d) {
            var e = a(".J_PicLoadding:first"), k = a("#J_GoodsPubD .gallery-bd").scrollable();
            b = !0;
            switch (c) {
                case "100":
                    setTimeout(function () {
                        a("#J_AddPicD").fadeOut("fast");
                        (new Image).src = d;
                        if (0 < a("#J_GoodsPubD .items img").length)if (8 > a("#J_GoodsPubD .items img").length) {
                            var b = '<li class="selected"><a href="javascript:;"><img src="' + d + '" alt="" /></a><i></i></li>';
                            a("#J_GoodsPubD .items ul:last").append(b);
                            a("#J_GoodsPubD .items img").resizeImage(94, 94)
                        } else 0 != a("#J_GoodsPubD .items img").length % 8 ? (b = '<li class="selected"><a href="javascript:;"><img src="' + d + '" alt="" /></a><i></i></li>', a("#J_GoodsPubD .items ul:last").append(b), a("#J_GoodsPubD .items img").resizeImage(94,
                            94)) : (b = '<ul><li class="selected"><a href="javascript:;"><img src="' + d + '" alt="" /></a><i></i></li></ul>', a("#J_GoodsPubD .items").append(b), a("#J_GoodsPubD .items img").resizeImage(94, 94), b = parseInt(a(".totalP").text()) + 1, a(".totalP").text(b), a(".curP").text(b)), k.end(); else b = '<ul><li><a href="javascript:;"><img src="' + d + '" alt="" /></a><i></i></li></ul>', a("#J_GoodsPubD .items").append(b), a("#J_GoodsPubD .items img").resizeImage(94, 94)
                    }, 1E3);
                    break;
                case "101":
                    a(".text-tip").html('<span class="errc">\u4eb2,\u8bf7\u6c42\u51fa\u9519\uff0c\u8bf7\u91cd\u65b0\u53d1\u9001\u8bf7\u6c42\u8bd5\u8bd5!</span>').show();
                    e.css("visibility", "hidden");
                    break;
                case "105":
                    a(".text-tip").html('<span class="errc">\u4eb2,\u6ca1\u6709\u4e0a\u4f20\u56fe\u7247\u7684\u6743\u9650.</span>').show();
                    e.css("visibility", "hidden");
                    break;
                case "300":
                    a(".text-tip").html('<span class="errc">\u4eb2,\u6ca1\u767b\u5f55.</span>').show();
                    e.css("visibility", "hidden");
                    break;
                case "800":
                    a(".text-tip").html('<span class="errc">\u4eb2,\u56fe\u7247\u56fe\u7247\u5927\u5c0f\u8d85\u8fc72M.</span>').show();
                    e.css("visibility", "hidden");
                    break;
                case "801":
                    a(".text-tip").html('<span class="errc">\u4eb2,\u56fe\u7247\u683c\u5f0f\u4e0d\u5bf9.</span>').show();
                    e.css("visibility", "hidden");
                    break;
                case "802":
                    a(".text-tip").html('<span class="errc">\u4eb2,\u56fe\u7247\u5c3a\u5bf8\u4e0d\u7b26\u5408.</span>').show(), e.css("visibility", "hidden")
            }
        }
    };
    a.guang.ugc = {pubJson:{}, getCmt:function (b) {
        var c = a.guang.util.trim(a(b + " textarea[name=proComment]").val());
        return 1E3 < a.guang.util.getStrLength(c) ? (a(b + " .goods-act").find(".errc").show().html("\u8bc4\u8bba\u6570\u4e0d\u80fd\u8d85\u8fc71000\u5b57"), !1) : "" == c ? "none" : c
    }, getTags:function (b) {
        for (var c = a.guang.util.trim(a(b +
            " input[name=tags]").val()), d = c.replace(/&/g, "\uff06").replace(/\//g, "\uff0f").replace(/#/g, "\uff03").replace(/\\uff0c|\s+/g, ",").split(","), e = [], f = 0, g = d.length; f < g; f++)"" != d[f] && e.push({tagKeyword:d[f]});
        return-1 != a.inArray("\u7cbe\u54c1", d) ? (a(b + " .goods-act").find(".errc").show().html("\u6807\u7b7e\u4e2d\u4e0d\u80fd\u5305\u542b\u201c\u7cbe\u54c1\u201d"), !1) : 200 < a.guang.util.getStrLength(c) ? (a(b + " .goods-act").find(".errc").show().html("\u6807\u7b7e\u4e0d\u80fd\u8d85\u8fc7200\u5b57"), !1) : e
    }, pubSuccess:function () {
        if (a("#J_PubSuccessD")[0])a("#J_PubSuccessD").data("overlay").load();
        else {
            var b;
            b = '<div id="J_PubSuccessD" class="g-dialog"><div class="dialog-content"><div class="bd clearfix"><p class="success-text"><span class="correct">\u5b9d\u8d1d\u53d1\u5e03\u6210\u529f\uff01</span></p>' + ('<p class="clearfix"><a class="bbl-btn goCheck" href="' + GUANGER.path + "/u/" + GUANGER.userId + '/share">\u524d\u5f80\u67e5\u770b\u5b9d\u8d1d</a>');
            a("body").append(b + '<a class="bgr-btn closeD ml10" href="javascript:;">\u5173\u95ed</a></p></div></div></div>');
            a("#J_PubSuccessD").overlay({top:"center",
                mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!1, load:!0})
        }
        a("#J_PubSuccessD .closeD").click(function () {
            a("#J_PubSuccessD").overlay().close()
        })
    }, goodsExist:function (b, c) {
        a.guang.ugc.pubJson = {proId:b.proId, productVoId:b.productVoId, productName:"", productMerchant:"", url:"", price:"", salesVolume:"", proComment:"", tags:null, photos:[], favor:"false", typeVO:b.typeVO, statusVO:b.statusVO};
        var d = 0 < b.pictures.length ? b.pictures[0].src : "images/user/photo/avatar-80.png";
        if (a("#J_GoodsExistD")[0])a("#J_GoodsExistD").data("overlay").load();
        else {
            var e;
            e = '<div id="J_GoodsExistD" class="g-dialog ugc-dialog"><div class="dialog-content"><div class="hd"><h3>\u901b\u901b\u4e0a\u5df2\u7ecf\u6709\u8fd9\u4e2a\u5b9d\u8d1d\u5566</h3></div><div class="bd clearfix">' + ('<form id="J_GoodsExistForm" action="' + GUANGER.path + '/ugc/api/upateProduct" method="POST">');
            e = e + '<div class="clearfix"><div class="goods-avatar">' + ('<a href="' + GUANGER.path + "/baobei/" + b.productVoId + '" target="_blank" title="' + b.productName + '"><img src="' + d + '" alt="' + b.productName +
                '" /></a>');
            e = e + '</div><div class="goods-info">' + ('<p class="goodsNm"><a href="' + GUANGER.path + "/baobei/" + b.productVoId + '" target="_blank" title="' + b.productName + '">' + b.productName + "</a></p>");
            a("body").append(e + '<p class="pb5">\u8bc4\u8bba\u4e00\u4e0b\uff1a</p><p><textarea class="base-txa" name="proComment" placeholder="\u559c\u6b22\u5b83\u4ec0\u4e48\u5462\uff1f"></textarea></p><p class="pt10 pb5">\u5b9d\u8d1d\u6807\u7b7e\uff1a</p><p><input type="text" rel="tagsInput" class="base-input" name="tags" value="" /></p><p class="pt5 gc">\u591a\u4e2a\u6807\u7b7e\u7528\u7a7a\u683c\u3001\u4e2d\u6587\u6216\u82f1\u6587\u9017\u53f7\u9694\u5f00</p></div></div><div class="goods-act"><div class="clearfix"><a class="bbl-btn" id="J_GoodsSave" href="javascript:;">\u786e\u5b9a</a><label class="fl mt15 ml15 gc6"><input type="checkbox" name="tomyfav" /> \u52a0\u5165\u6211\u559c\u6b22\u7684\u5b9d\u8d1d</label></div><div class="errc mt10"></div></div></form></div><a class="close" href="javascript:;"></a></div></div>');
            a("#J_GoodsExistD").overlay({top:"center", mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!1, load:!0});
            a("#J_GoodsSave").unbind().bind("click", function () {
                $this = a(this);
                if ($this.hasClass("disabled"))return!1;
                var b = a.guang.ugc.getCmt("#J_GoodsExistD");
                if ("none" == b)b = ""; else if (!b)return!1;
                var d = a.guang.ugc.getTags("#J_GoodsExistD");
                if (!d)return!1;
                a.guang.ugc.pubJson.proComment = b;
                a.guang.ugc.pubJson.tags = d;
                a.guang.ugc.pubJson.favor = a("#J_GoodsExistForm input[name=tomyfav]")[0].checked ? "true" :
                    "false";
                a.ajax({url:a("#J_GoodsExistForm").attr("action"), type:"post", dataType:"json", data:{data:JSON.stringify(a.guang.ugc.pubJson)}, beforeSend:function () {
                    $this.disableBtn("bbl-btn");
                    a(".goods-act").find(".errc").show().html('<p class="ajaxvali pl20">\u4fdd\u5b58\u4e2d...</p>')
                }, success:function (d) {
                    100 == d.code ? (a("#J_GoodsExistD").overlay().close(), a("#J_GoodsExistD").empty().remove(), -1 != window.location.href.indexOf("/share") ? (a.guang.tip.conf.tipClass = "tipmodal tipmodal-ok", a.guang.tip.show($this,
                        "\u5b9d\u8d1d\u53d1\u5e03\u6210\u529f\uff01"), window.location.href = window.location.href) : c ? c(a.guang.ugc.pubJson.productVoId, b) : a.guang.ugc.pubSuccess()) : 101 == d.code ? (a("#J_GoodsExistD").find(".errc").show(), a("#J_GoodsExistD").find(".errc").html("\u51fa\u9519\u4e86\uff0c\u8bf7\u91cd\u8bd5\u2026"), $this.enableBtn("bbl-btn")) : 102 == d.code && (a(".text-tip").html('<span class="errc">\u8f93\u5165\u7684\u6807\u7b7e\u6216\u8bc4\u8bba\u8fc7\u957f</span>').show(), $this.enableBtn("bbl-btn"))
                }});
                return!1
            });
            a("#J_GoodsExistForm").submit(function () {
                return!1
            });
            a("#J_GoodsExistD").overlay().getClosers().bind("click", function () {
                a("#J_GoodsExistD").empty().remove()
            })
        }
    }, goodspub:function (b, c, d) {
        a.guang.ugc.pubJson = {proId:b.proId, productVoId:b.productVoId, productName:b.productName, productMerchant:b.productMerchant, url:b.url, price:b.price, salesVolume:b.salesVolume, proComment:"", tags:null, photos:[], favor:"false", typeVO:b.typeVO, statusVO:b.statusVO, likeNumber:b.likeNumber, collectionNumber:b.collectionNumber, commentNumber:b.commentNumber};
        var e = !1;
        c && (e = c);
        if (a("#J_GoodsPubD")[0])a("#J_GoodsPubD").data("overlay").load();
        else {
            c = '<div id="J_GoodsPubD" class="g-dialog ugc-dialog"><div class="dialog-content"><div class="hd"><h3>\u55ef~ \u5c31\u662f\u5b83\u5427</h3></div><div class="bd clearfix">' + ('<form id="J_GoodsPubForm" action="' + GUANGER.path + '/ugc/api/saveProduct" method="POST">');
            c = c + '<div class="form-row"><label>\u5b9d\u8d1d\u540d\u79f0\uff1a</label>' + ('<span class="goodsNm">' + b.productName + "</span>");
            a("body").append(c + '</div><div class="form-row"><label>\u8bc4\u8bba\u4e00\u4e0b\uff1a</label><textarea class="base-txa" name="proComment" placeholder="\u559c\u6b22\u5b83\u4ec0\u4e48\u5462\uff1f"></textarea></div><div class="form-row"><label>\u5b9d\u8d1d\u6807\u7b7e\uff1a</label><div class="inlineblock"><input type="text" rel="tagsInput" class="base-input" name="tags" value="" /><p class="pt5 gc">\u591a\u4e2a\u6807\u7b7e\u7528\u7a7a\u683c\u3001\u4e2d\u6587\u6216\u82f1\u6587\u9017\u53f7\u9694\u5f00</p></div></div><div class="form-row clearfix"><label>\u5b9d\u8d1d\u56fe\u7247\uff1a</label><div class="goods-gallery"><div class="gallery-bd"><div class="items"></div></div><div class="gallery-ft clearfix"><span class="status">\u5df2\u9009 <em>0</em> \u5f20</span><span class="errc"></span><div class="gallery-pagin"><a href="javascript:;" class="sgr-btn prev">\u4e0a\u9875</a><span class="num-box"><em class="curP">1</em>/<em class="totalP"></em></span><a href="javascript:;" class="sgr-btn next">\u4e0b\u9875</a></div><a href="javascript:;" id="J_AddPicBtn" class="ap-btn sgr-btn" style="">\u4e0a\u4f20\u672c\u5730\u56fe\u7247</a></div></div></div><div class="goods-act"><div class="clearfix"><a class="bbl-btn" id="J_GoodsPub" href="javascript:;">\u53d1\u5e03</a><label class="fl mt15 ml15 gc6"><input type="checkbox" name="tomyfav" /> \u52a0\u5165\u6211\u559c\u6b22\u7684\u5b9d\u8d1d</label></div><div class="errc mt10"></div></div></form></div><a class="close" href="javascript:;"></a></div></div>');
            !0 == e ? (a("#J_AddPicBtn").show(), a("#J_AddPicBtn").live("click", function () {
                a(this).addLocalPic()
            }), a("#J_GoodsPubD .close").bind("click", function () {
                a("#J_AddPicD").fadeOut("fast")
            })) : a("#J_AddPicBtn").hide();
            a("#J_GoodsPubD").overlay({top:"center", fixed:!1, mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!1, load:!0});
            e = b.photos;
            c = "";
            if (0 < e.length) {
                c += "<ul>";
                if ("item.buy.qq.com" == a.guang.util.getDomain(b.url))c += '<li><a href="javascript:;"><img src="' + e[0] + '" alt="" /></a><i></i></li>'; else for (var b =
                    0, f = e.length; b < f; b++)c += '<li><a href="javascript:;"><img src="' + e[b] + '" alt="" /></a><i></i></li>', 0 == (b + 1) % 8 && b != e.length - 1 && (c += "</ul><ul>");
                a("#J_GoodsPubD .items").append(c + "</ul>");
                a("#J_GoodsPubD .gallery-bd").scrollable({vertical:!0});
                a("#J_GoodsPubD .prev").click(function () {
                    var b = parseInt(a(".curP").text());
                    parseInt(a(".totalP").text());
                    b > 1 && a(".curP").text(b - 1)
                });
                a("#J_GoodsPubD .next").click(function () {
                    var b = parseInt(a(".curP").text()), c = parseInt(a(".totalP").text());
                    b < c && a(".curP").text(b +
                        1)
                });
                a("#J_GoodsPubD .totalP").text(a("#J_GoodsPubD ul").length)
            }
            a("#J_GoodsPubD li a, #J_GoodsPubD li i").die().live("click", function (b) {
                b.preventDefault();
                a("#J_GoodsPubD .gallery-ft").find(".status").show();
                a("#J_GoodsPubD .gallery-ft").find(".errc").hide();
                a(this).parent("li").hasClass("selected") ? a(this).parent("li").removeClass("selected") : a(this).parent("li").addClass("selected");
                a("#J_GoodsPubD .status em").text(a("#J_GoodsPubD li.selected").length)
            });
            a("#J_GoodsPub").unbind().bind("click",
                function () {
                    $this = a(this);
                    if ($this.hasClass("disabled"))return false;
                    var b = [];
                    a("#J_GoodsPubD li.selected").each(function () {
                        b.push(a(this).find("img").attr("src"))
                    });
                    var c = a.guang.ugc.getCmt("#J_GoodsPubD");
                    if (c == "none")c = ""; else if (!c)return false;
                    var e = a.guang.ugc.getTags("#J_GoodsPubD");
                    if (!e)return false;
                    a.guang.ugc.pubJson.proComment = c;
                    a.guang.ugc.pubJson.tags = e;
                    a.guang.ugc.pubJson.photos = b;
                    a.guang.ugc.pubJson.favor = a("#J_GoodsPubForm input[name=tomyfav]")[0].checked ? "true" : "false";
                    if (b.length ==
                        0) {
                        a("#J_GoodsPubD .gallery-ft").find(".status").hide();
                        a("#J_GoodsPubD .gallery-ft").find(".errc").show();
                        a("#J_GoodsPubD .gallery-ft").find(".errc").html("\u81f3\u5c11\u8981\u9009\u4e00\u5f20\u54e6");
                        return false
                    }
                    a.ajax({url:a("#J_GoodsPubForm").attr("action"), type:"post", dataType:"json", data:{data:JSON.stringify(a.guang.ugc.pubJson)}, beforeSend:function () {
                        $this.disableBtn("bbl-btn");
                        a(".goods-act").find(".errc").show().html('<p class="ajaxvali pl20">\u53d1\u5e03\u4e2d...</p>')
                    }, success:function (b) {
                        a("#J_AddPicD").fadeOut("fast");
                        if (b.code == 100) {
                            a("#J_GoodsPubD").overlay().close();
                            a("#J_GoodsPubD").empty().remove();
                            if (window.location.href.indexOf("/share") != -1) {
                                a.guang.tip.conf.tipClass = "tipmodal tipmodal-ok";
                                a.guang.tip.show($this, "\u5b9d\u8d1d\u53d1\u5e03\u6210\u529f\uff01");
                                window.location.href = window.location.href
                            } else d ? d(b.productId, c) : a.guang.ugc.pubSuccess()
                        } else if (b.code == 101) {
                            a("#J_GoodsPubD .goods-act").find(".errc").show();
                            a("#J_GoodsPubD .goods-act").find(".errc").html("\u51fa\u9519\u4e86\uff0c\u8bf7\u91cd\u8bd5\u2026");
                            $this.enableBtn("bbl-btn")
                        } else if (b.code == 102) {
                            a("#J_GoodsPubD .goods-act").find(".errc").html("\u8f93\u5165\u7684\u6807\u7b7e\u6216\u8bc4\u8bba\u8fc7\u957f").show();
                            $this.enableBtn("bbl-btn")
                        } else if (b.code == 112) {
                            a("#J_GoodsPubD .goods-act").find(".errc").html("\u8bf7\u8ba4\u771f\u586b\u5199\u5546\u54c1\u8bc4\u8bba").show();
                            $this.enableBtn("bbl-btn")
                        }
                    }});
                    return false
                });
            a("#J_GoodsPubForm").submit(function () {
                return false
            });
            a("#J_GoodsPubD").overlay().getClosers().bind("click", function () {
                a("#J_GoodsPubD").empty().remove()
            })
        }
    }};
    a("a[rel=shareGoods]")[0] && a("a[rel=shareGoods]").click(function () {
        if (!a.guang.dialog.isLogin())return!1;
        if ("true" == GUANGER.isBlack)return alert("\u60a8\u7684\u5206\u4eab\u529f\u80fd\u5df2\u88ab\u7981\u7528"), !1;
        var b = a(this);
        if (a("#J_ShareGoodsD")[0])a(".sg-input").val(""), a(".text-tip").html(""); else {
            var c;
            c = '<div id="J_ShareGoodsD" class="g-dialog sg-dialog"><div class="content"><p class="title">\u5c06\u5b9d\u8d1d\u7f51\u5740\u7c98\u8d34\u5230\u4e0b\u9762\u6846\u4e2d\uff1a</p>' + ('<form class="sg-form" name="shareGoods" action="' +
                GUANGER.path + '/ugc/api/findProduct">');
            a("body").append(c + '<div class="clearfix"><input class="base-input sg-input" name="url" value="" placeholder="http://" autocomplete="off" /><input type="submit" id="J_GoodsUrlSubmit" class="bbl-btn url-sub" value="\u786e\u5b9a" /></div><div class="text-tip"></div></form><div class="sg-source"><p class="pt5 pb5">\u5df2\u652f\u6301\u7f51\u7ad9\uff08<a href="http://guang.com/contact" target="_blank">\u5546\u5bb6\u7533\u8bf7\u52a0\u5165</a>\uff09\uff1a</p><div class="source-list clearfix"><a class="icon-source icon-taobao" href="http://www.taobao.com/" target="_blank">\u6dd8\u5b9d\u7f51</a><a class="icon-source icon-tmall" href="http://www.tmall.com/" target="_blank">\u5929\u732b\u5546\u57ce</a><a class="icon-source icon-paipai" href="http://buy.qq.com/" target="_blank">QQ\u7f51\u8d2d</a><a class="icon-source icon-mbaobao" href="http://www.mbaobao.com/" target="_blank">\u9ea6\u5305\u5305</a><a class="icon-source icon-vancl" href="http://www.vancl.com/" target="_blank">\u51e1\u5ba2\u8bda\u54c1</a></div></div><div class="tipbox-up"><em>\u25c6</em><span>\u25c6</span></div><a class="close" href="javascript:;"></a></div></div>');
            a(".sg-dialog .close").click(function () {
                a("#J_ShareGoodsD").fadeOut("fast")
            });
            a(".sg-form").submit(function () {
                var b = a(this), c = a.guang.util.trim(a(".sg-input").val());
                "" == c ? a(".text-tip").html('<span class="errc">\u5b9d\u8d1d\u7f51\u5740\u4e0d\u80fd\u4e3a\u7a7a~</span>').show() : a.guang.util.validSite(c) ? (a(".text-tip").html('<span class="gc6">\u5b9d\u8d1d\u4fe1\u606f\u6293\u53d6\u4e2d\u2026</span>').show(), a("#J_GoodsUrlSubmit").disableBtn("bbl-btn"), a.post(b.attr("action"), b.serializeArray(), function (b) {
                    if (100 ==
                        b.code)a("#J_ShareGoodsD").hide(), a.guang.ugc.goodspub(b.product, b.isUploadRole); else if (105 == b.code)a("#J_ShareGoodsD").hide(), a.guang.ugc.goodsExist(b.product); else if (101 == b.code || 106 == b.code)a(".text-tip").html('<span class="errc">\u5b9d\u8d1d\u4fe1\u606f\u6293\u53d6\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u2026</span>').show(); else if (107 == b.code)a(".text-tip").html('<span class="errc">\u6682\u65f6\u8fd8\u4e0d\u652f\u6301\u8fd9\u4e2a\u5b9d\u8d1d\u2026</span>').show(); else if (108 == b.code)a(".text-tip").html('<span class="errc">\u4f60\u5df2\u7ecf\u5206\u4eab\u8fc7\u8fd9\u4e2a\u5b9d\u8d1d\u5566\u2026</span>').show();
                    else if (110 == b.code)a(".text-tip").html('<span class="errc">\u4eb2\uff0c\u8be5\u5546\u54c1\u6240\u5728\u5546\u5bb6\u5df2\u5217\u5165\u9ed1\u540d\u5355\uff0c\u7533\u8bc9\u8bf7\u8054\u7cfbGCTU@guang.com</span>').show(); else if (444 == b.code)alert("\u4f60\u5df2\u88ab\u7981\u6b62\u767b\u5f55\uff01"), window.location.href = "http://guang.com/logout"; else if (442 == b.code)if (0 == a("#J_PublishGoodsDialog").length) {
                        a("body").append('<div id="J_PublishGoodsDialog" class="g-dialog" style="width:430px;"><div class="dialog-content"><div class="hd"><h3>\u901a\u77e5</h3></div><div class="bd clearfix" style="padding:30px;"><p style="line-height:26px;font-size:14px;">\u4e0d\u80fd\u9891\u7e41\u53d1\u5e03\u540c\u4e00\u5e97\u94fa\u5546\u54c1\uff0c<em style="color:#E26">\u5426\u5219\u8d26\u6237\u5c06\u88ab\u51bb\u7ed3\u3002</em><br/>\u5982\u679c\u4f60\u662f\u4f18\u8d28\u5546\u5bb6\uff0c\u8bf7\u4e0e\u6211\u4eec<a href="http://guang.com/contact" target="_blank">\u5546\u5bb6\u5408\u4f5c</a>\u76f8\u5173\u4eba\u5458\u8054\u7cfb\u3002</p><a class="bbl-btn" id="J_CloseOverlay" style="margin-left:146px;margin-top:20px;font-size:14px;" href="http://guang.com/contact">\u53bb\u770b\u770b&gt</a></div><a class="close" href="javascript:;"></a></div></div>');
                        var c = a("#J_PublishGoodsDialog");
                        c.overlay({top:"center", mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!0, load:!0});
                        a("#J_CloseOverlay").bind("click", function () {
                            c.overlay().close()
                        })
                    } else a("#J_PublishGoodsDialog").overlay().load()(); else if (443 == b.code || 445 == b.code)0 == a("#J_PublishGoodsDialog").length ? (a("body").append('<div id="J_PublishGoodsDialog" class="g-dialog" style="width:430px;"><div class="dialog-content"><div class="hd"><h3>\u901a\u77e5</h3></div><div class="bd clearfix" style="padding:30px;"><p style="line-height:26px;font-size:14px;text-align:center;"><em style="color:#E26">\u8d26\u6237\u5df2\u88ab\u51bb\u7ed3\uff01</em></p><p style="line-height:26px;font-size:14px;padding-left:20px;">\u00b7\u666e\u901a\u7528\u6237\uff0c\u7533\u8bc9\u90ae\u7bb1gctu@guang.com\uff08\u8bf7\u9644\u5e26\u7528\u6237\u540d\uff09<br/>\u00b7\u4f18\u8d28\u5546\u5bb6\uff0c\u8bf7\u4e0e\u6211\u4eec<a href="http://guang.com/contact" target="_blank">\u5546\u5bb6\u5408\u4f5c</a>\u76f8\u5173\u4eba\u5458\u8054\u7cfb\u3002</p><a class="bbl-btn" id="J_CloseOverlay" style="margin-left:146px;margin-top:20px;font-size:14px;" href="javascript:;">\u77e5\u9053\u4e86&gt</a></div><a class="close" href="javascript:;"></a></div></div>'),
                        c = a("#J_PublishGoodsDialog"), c.overlay({top:"center", mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!0, load:!0}), a("#J_CloseOverlay").bind("click", function () {
                        c.overlay().close()
                    })) : a("#J_PublishGoodsDialog").overlay().load();
                    a("#J_GoodsUrlSubmit").enableBtn("bbl-btn")
                })) : a(".text-tip").html('<span class="errc">\u6682\u65f6\u8fd8\u4e0d\u652f\u6301\u8fd9\u4e2a\u7f51\u7ad9\u5462~</span>').show();
                return!1
            })
        }
        b.hasClass("hd-share-goods") ? a(".shareIt").append(a("#J_ShareGoodsD")) : a("body").append(a("#J_ShareGoodsD"));
        c = a.guang.util.getPosition(b).leftBottom();
        var d = a("#J_ShareGoodsD").outerWidth();
        a("#J_ShareGoodsD").outerHeight();
        var e = b.outerWidth(), f = c.x, g = e / 2 - 8;
        960 < c.x + d && (f = c.x - (d - e), g = d - e / 2 - 8);
        a("#J_ShareGoodsD .tipbox-up").css({left:g + "px"});
        b.hasClass("hd-share-goods") ? a("#J_ShareGoodsD").css({left:"auto", right:"0", top:"33px"}).fadeIn("fast") : a("#J_ShareGoodsD").css({right:"auto", left:f + "px", top:c.y + 10 + "px"}).fadeIn("fast");
        a(".sg-input").focus()
    });
    a("input[rel=tagsInput]").live("keyup", function () {
        var b =
            a(this).val();
        if (64 >= a.guang.util.getStrLength(a.guang.util.htmlToTxt(b))) {
            a(this);
            for (b = b.replace(/\uff0c|\s+/g, ","); 0 <= b.indexOf(",,");)b = b.replace(",,", ",");
            for (var c = b.split(","), d = 0, e = !1; d < c.length; d++) {
                var f = c[d];
                14 < a.guang.util.htmlToTxt(f).length && (e = !0, c[d] = a.guang.util.substring4ChAndEn(f, 14))
            }
            e && (b = c.join(","));
            b != this.value && (this.value = b)
        } else this.value = a.guang.util.substring4ChAndEn(b, 64)
    })
})(jQuery);
$(function () {
    var a = null, b = function (a) {
        a ? $("a[rel=signIn]").addClass("checked") : $("a[rel=signIn]").removeClass("checked")
    }, c = function (b, c, f) {
        $("#checkin_intro").unbind().remove();
        b.after('<div id="checkin_intro">\u8fde\u7b7e\uff1a<b class="checkin_days">' + (1 == (c.userCheckinDays + "").length ? "0" + c.userCheckinDays : c.userCheckinDays) + '</b>&nbsp;\u5929<br/>\u79ef\u5206\uff1a<b id="jifen">' + c.userScore + '</b>&nbsp;\u5206<br/><p>\u7b7e\u5230\uff1a10\u79ef\u5206/\u5929<br/>\u8fde\u7b7e7\u5929\uff1a\u9001100<br/>\u8fde\u7b7e15\u5929\uff1a\u9001300<br/>\u8fde\u7b7e22\u5929\uff1a\u90011000<br/><a href="' +
            GUANGER.path + '/account/invitation" target="_blank">\u9080\u8bf7\u53ef\u83b7\u66f4\u591a\u79ef\u5206</a></p></div>');
        $("#checkin_intro").hover(function () {
            null != a && clearTimeout(a)
        }, function () {
            a = setTimeout(function () {
                $("#checkin_intro").remove()
            }, 500)
        });
        var g = function (a, b, c) {
            a >= b && $("#jifen")[0] ? $("#jifen").html(b) : ($("#jifen").html(a + c), setTimeout(function () {
                g(a + c, b, c)
            }, 50))
        };
        "show" == f && g(c.userScore / 2, c.userScore, 1 > c.userScore / 20 ? 1 : Math.floor(c.userScore / 20))
    };
    (function () {
        if (1 >= GUANGER.userId.length)return"Not login";
        $.ajax({url:GUANGER.path + "/user_score", type:"post", dataType:"json", success:function (a) {
            100 == a.code ? b(a.status) : 101 != a.code && 300 == a.code && b(!1)
        }})
    })();
    $("a[rel=signIn]").click(function () {
        if (!$.guang.dialog.isLogin() || $("a[rel=signIn]").hasClass("checked"))return!1;
        var a = $(this);
        $.ajax({url:GUANGER.path + "/user_checkin", type:"post", dataType:"json", success:function (e) {
            100 == e.code ? (c(a, e, "show"), b(!0)) : 101 == e.code ? ($.guang.tip.conf.tipClass = "tipmodal tipmodal-error3", $.guang.tip.show(a, ">_< \u7b7e\u5230\u5931\u8d25\uff01")) :
                103 == e.code ? (c(a, e), b(!0)) : 300 == e.code && $.guang.dialog.login()
        }})
    });
    $("a[rel=signIn]").hover(function () {
        if (1 >= GUANGER.userId.length)return"Not login";
        $this = $(this);
        $.ajax({url:GUANGER.path + "/user_score", type:"post", dataType:"json", success:function (a) {
            100 == a.code ? c($this, a) : 101 == a.code ? (a.userScore = 0, a.userCheckinDays = 0, c($this, a)) : 300 == a.code && $.guang.dialog.login()
        }})
    }, function () {
        $("#checkin_intro")[0] && (a = setTimeout(function () {
            $("#checkin_intro").remove()
        }, 500))
    });
    $("a[rel=J_InviteFellowJudge]").click(function () {
    });
    $(".hd-create-topic").click(function () {
        if (!$.guang.dialog.isLogin())return!1
    })
});
(function (a) {
    a.fn.shareBtn = function () {
        a(".share-dropdown")[0] || a("body").append('<ul class="share-link share-dropdown"><li><a class="s-sina" href="javascript:;">\u5206\u4eab\u5230\u65b0\u6d6a\u5fae\u535a</a></li><li><a class="s-qzone" href="javascript:;">\u5206\u4eab\u5230QQ\u7a7a\u95f4</a></li><li><a class="s-tencent" href="javascript:;">\u5206\u4eab\u5230\u817e\u8baf\u5fae\u535a</a></li><li><a class="s-douban" href="javascript:;">\u5206\u4eab\u5230\u8c46\u74e3</a></li><li><a class="s-renren" href="javascript:;">\u5206\u4eab\u5230\u4eba\u4eba\u7f51</a></li><li><a class="s-163" href="javascript:;">\u5206\u4eab\u5230\u7f51\u6613\u5fae\u535a</a></li></ul>');
        return this.each(function () {
            var b =
                a(this);
            b.bind("mouseover", function () {
                a(".share-dropdown a").unbind("click").click(function () {
                    var c = a(this).attr("class"), d = encodeURIComponent(b.data("sharetxt")), e = b.data("sharelink"), f = encodeURIComponent(b.data("sharepic"));
                    -1 == e.indexOf("http://guang.com") && (e = encodeURIComponent("http://guang.com" + e));
                    switch (c) {
                        case "s-sina":
                            window.open("http://service.t.sina.com.cn/share/share.php?appkey=1207757825&title=" + d + "&pic=" + f + "&url=" + e);
                            break;
                        case "s-tencent":
                            window.open("http://v.t.qq.com/share/share.php?appkey=801128565&url=" +
                                e + "&title=" + d + "&pic=" + f + "&site=" + e);
                            break;
                        case "s-douban":
                            window.open("http://www.douban.com/recommend/?url=" + e + "&title=" + d);
                            break;
                        case "s-qzone":
                            window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + e);
                            break;
                        case "s-renren":
                            window.open("http://share.renren.com/share/buttonshare.do?link=" + e + "&title=" + d);
                            break;
                        case "s-163":
                            window.open("http://t.163.com/article/user/checkLogin.do?link=" + e + "&source=&info=" + d + "&images=" + f)
                    }
                })
            });
            b.dropDown({classNm:".share-dropdown", offsetX:122,
                offsetY:0, isLocation:!0})
        })
    }
})(jQuery);
$(function () {
    if (0 < GUANGER.userId.length && $("a[rel=xiaoxi]")[0]) {
        var a = function (a) {
            var c = !1, d;
            d = "<div class='xiaoxi-tip'><a href='javascript:;' class='closetip'>x</a>";
            a.fansMessageNum && (c = !0, d += "<div class='xiaoxi-item' data-type='fans'><a href='" + GUANGER.path + "/u/" + GUANGER.userId + "/fans'>" + a.fansMessageNum + " \u4f4d\u65b0\u7c89\u4e1d</a></div>");
            a.commentMessageNum && (c = !0, d += "<div class='xiaoxi-item' data-type='comments'><a href='" + GUANGER.path + "/xiaoxi/comment'>" + a.commentMessageNum + " \u6761\u65b0\u8bc4\u8bba</a></div>");
            a.replyMessageNum && (c = !0, d += "<div class='xiaoxi-item' data-type='reply'><a href='" + GUANGER.path + "/xiaoxi/reply'>" + a.replyMessageNum + " \u6761\u65b0\u56de\u590d</a></div>");
            a.atMessageNum && (c = !0, d += "<div class='xiaoxi-item' data-type='at'><a href='" + GUANGER.path + "/xiaoxi/at'>" + a.atMessageNum + " \u6761\u65b0@\u6211</a></div>");
            a.appraisalMessageNum && (c = !0, d += "<div class='xiaoxi-item' data-type='appraisal'><a href='" + GUANGER.path + "/xiaoxi/appraisal'>" + a.appraisalMessageNum + " \u6761\u65b0\u9274\u5b9a</a></div>");
            a.systemMessageNum && (c = !0, d += "<div class='xiaoxi-item' data-type='sys'><a href='" + GUANGER.path + "/xiaoxi/system'>" + a.systemMessageNum + " \u4e2a\u65b0\u901a\u77e5</a></div>");
            c && $("#header .person").after(d + "</div>");
            0 < a.feedsMessageNum && (a = "<span class='xiaoxi-sum'>" + (99 < a.feedsMessageNum ? "N" : a.feedsMessageNum) + "</span>", $("#header #feeds-xiaoxi").append(a));
            $("#header .xiaoxi-tip .closetip").click(function () {
                var a = $(this).parent(".xiaoxi-tip");
                $.ajax({url:GUANGER.path + "/cancel_notify", type:"post",
                    dataType:"json", data:{}, success:function () {
                        a.fadeOut(500)
                    }})
            })
        };
        $.ajax({url:GUANGER.path + "/message_count", type:"post", dataType:"json", success:function (b) {
            100 == b.code && (0 < b.fansMessageNum || 0 < b.commentMessageNum || 0 < b.replyMessageNum || 0 < b.atMessageNum || 0 < b.appraisalMessageNum || 0 < b.systemMessageNum || 0 < b.feedsMessageNum) && a(b)
        }})
    }
});
$(function () {
    $(window).bind("scroll", function () {
        var a = $(document).scrollTop();
        $.guang.util.isIOS() || (83 < a ? ($(".m-nav").addClass("fixed"), $(".header-nav-search").show()) : ($(".m-nav").removeClass("fixed"), $(".header-nav-search").hide()))
    });
    $(".login-dropdown a").unbind("click").click(function () {
        var a = $(this).attr("href");
        $.guang.util.openWin(a);
        return!1
    });
    $(".regLogin").dropDown({classNm:".login-dropdown"});
    $(".gohome").dropDown({classNm:".set-dropdown"});
    $(".xiaoxi").dropDown({classNm:".xiaoxi-dropdown"});
    $(".btn-sg").dropDown({classNm:".shareit-dropdown"});
    $(".weibo-login").dropDown({classNm:".weibo-dropdown"});
    $(".btn-sg").bind("mouseover", function () {
        $("#checkin_intro")[0] && $("#checkin_intro").remove()
    });
    $("#returnTop").returntop()
});
function countAdNum(a){
    a = $(a);
    $.ajax({
            url:GUANGER.path + "/advertisement/clickAdv",
            type:"post",
            dataType:"json",
            data:{id:a.attr("data")},
            success:function () {

            }
        })
};
